package com.liaogui.framework.register;

import java.util.HashMap;
import java.util.Map;

/**
 * 服务提供者本地注册的map
 * @author liaogui
 * @date 2025/4/16 21:22
 */
public class LocalRegister {
    private static Map<String, Class> map = new HashMap<>();

    public static void register(String interfaceName, String version, Class implClass) {
        String interfaceNameStr = interfaceName + version;
        map.put(interfaceNameStr, implClass);
        // 注册到redis
        RedisClient redisClient = new RedisClient("127.0.0.1", 6379, "umbs123", 2);
        redisClient.registerService(interfaceNameStr, "http://127.0.0.1:8085");
    }

    public static Class get(String interfaceName, String version) {
        return map.get(interfaceName + version);
    }
}
